#ifndef A6_VENDING_MACHINE_H
#define A6_VENDING_MACHINE_H
#include <uC++.h>
#include "Printer.h"
#include "WATCard.h"
#include "NameServer.h"

_Task NameServer;

_Task VendingMachine 
{
    Printer&	myPrinter;
    NameServer& myNameServer;
    unsigned int myID;
    unsigned int mySodaCost;
    unsigned int myMaxStockPerFlavour;
	unsigned int* myInventory;

	void main();

public:
	// flavours of soda (YOU DEFINE)
	enum Flavours { EROTIC_STRAWBERRY, HORSE_SEMEN, FLAVOUR_SIZE }; 			
	// purchase status: successful buy, out of stock, insufficient funds
	enum Status { BUY, STOCK, FUNDS };		

	~VendingMachine();
	VendingMachine( Printer &prt, NameServer &nameServer, 
					unsigned int id, unsigned int sodaCost,
					unsigned int maxStockPerFlavour );
	Status buy( Flavours flavour, WATCard &card );
	unsigned int *inventory();
	void restocked();
	_Nomutex unsigned int cost();
	_Nomutex unsigned int getId();
};
#endif
